package com.prj.ufdm.cloud.base.dto;

import java.io.Serializable;
import com.prj.ufdm.cloud.base.enums.BaseRetCodeEnum;

/**
 * DESC: 响应数据信息
 * @author 胡义振
 * @date 2018-03-19
 */
public class RetData<T> implements Serializable { 

	private static final long serialVersionUID = 1L;
	
	// 响应头
	private RetDataHead retHead;
	// 响应内容
	private T retBody;
	
	public RetData() {
		retHead = new RetDataHead();
		retHead.setCode(BaseRetCodeEnum.RET_CODE_0000000.getCode());
		retHead.setMessage(BaseRetCodeEnum.RET_CODE_0000000.getMessage());
	}
	
    public RetData(T retBody) {
        this.retBody = retBody;
    }
	
    public RetData(String retCode, String retMessage) {
    	retHead = new RetDataHead();
    	retHead.setCode(retCode);
    	retHead.setMessage(retMessage);
    }

	public RetDataHead getRetHead() {
		return retHead;
	}

	public void setRetHead(RetDataHead retHead) {
		this.retHead = retHead;
	}

	public T getRetBody() {
		return retBody;
	}

	public void setRetBody(T retBody) {
		this.retBody = retBody;
	}

	@Override
	public String toString() {
		return "RetData [retHead=" + retHead + ", retBody=" + retBody + "]";
	}

}


